﻿Imports System.Windows.Forms

Public Class settingsDialog

    Public Property SDFilePath As String

    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Close()
    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Close()
    End Sub

    Private Sub pathTextBox_TextChanged(sender As System.Object, e As System.EventArgs) Handles pathTextBox.TextChanged
        SDFilePath = pathTextBox.Text
    End Sub

    Private Sub browseButton_Click(sender As System.Object, e As System.EventArgs) Handles browseButton.Click
        Dim requester As New FolderBrowserDialog()
        requester.RootFolder = CType(SDFilePath, Environment.SpecialFolder)
        requester.Description = "Select root path of Tyrannt folder for SD card"
        requester.ShowDialog()
        pathTextBox.Text = requester.SelectedPath
    End Sub
End Class
